package com.lbn.jfqsc.net;

import com.lbn.baseframe.net.business.BaseModel;
import com.lbn.jfqsc.business.ResData;
import com.lbn.jfqsc.business.bean.ActivityList;
import com.lbn.jfqsc.business.bean.CommentList;
import com.lbn.jfqsc.business.bean.Good;
import com.lbn.jfqsc.business.bean.Goods;
import com.lbn.jfqsc.business.bean.JobList;

import com.lbn.jfqsc.business.bean.UpToken;

import com.lbn.jfqsc.business.bean.OrderList;
import com.lbn.jfqsc.business.bean.SupportList;

import com.lbn.jfqsc.business.bean.User;


import java.util.List;
import java.util.Map;

import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by 李炳南
 * 2017/3/4.
 */

public interface ApiService {


    @POST("v1/app/user/token")
    Observable<BaseModel<User>> token(@Body Map map);

    @GET("v1/app/goodsList/{page}/2")
    Observable<BaseModel<List<Goods>>> goodsList(@Path("page") int page);

    @GET("v1/app/goods/{id}")
    Observable<BaseModel<Good>> getGood(@Path("id") int id);

    @GET("v1/app/user/info/collection/{id}")
    Observable<BaseModel<Object>> collection(@Header("user_id") int userId, @Path("id") int goodId);

    @POST("v1/app/user")
    Observable<BaseModel<Object>> register(@Body Map map);

    @GET("v1/app/user/exist/{phone}")
    Observable<BaseModel<String>> register(@Path("phone") String phone);

    @GET("v1/app/activityList/{page}/10")
    Observable<BaseModel<List<ActivityList>>> activityList(@Path("page") int page, @Query("type") int type);

    @POST("v1/app/user/collection")
    Observable<BaseModel<Object>> collection(@Body Map map);

    @GET("v1/app/jobList/{page}/10")
    Observable<BaseModel<List<JobList>>> applyList(@Path("page") int page, @Query("type") int type);

    @GET("v1/app/supportList/{page}/10")
    Observable<BaseModel<List<SupportList>>> supportList(@Header("user_id") int userId, @Path("page") int page);

    @GET("v1/app/user/info/orderList/{page}/10")
    Observable<BaseModel<List<OrderList>>> orderList(@Header("user_id") int userId, @Path("page") int page);

    @POST("v1/app/activity/favorcount")
    Observable<BaseModel<Object>> favorcount(@Body Map map);

    @POST("v1/app/order")
    Observable<BaseModel<Object>> alipay(@Body Map map);

    @POST("v1/app/support")
    Observable<BaseModel<Object>> support(@Body Map map);

    @GET("v1/app/user/info/upToken")
    Observable<BaseModel<UpToken>>upToken();

    @POST("v1/app/user/info/data")
    Observable<BaseModel<Object>>upInfo(@Body Map map);

    @POST("v1/app/comment")
    Observable<BaseModel> comment(@Body Map map);

    @GET("v1/app/commentList/{page}/10")
    Observable<BaseModel<List<CommentList>>> commentList(@Path("page") int page, @Query("activityId") int actId);

    @POST("v1/app/activity/info")
    Observable<BaseModel<Object>> activityInfo(@Body Map map);

    @POST("v1/app/job/info")
    Observable<BaseModel<Object>> jobInfo(@Body Map map);

}
